//
//  UILable+Extension.swift
//  MicroBlog
//
//  Created by lj on 15/9/6.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(title: String?,color: UIColor, fontSize: CGFloat ,layoutWidth: CGFloat = 0 ){
        self.init()
        //设置对象的属性
        text = title
        textColor = color
        font = UIFont.systemFontOfSize(fontSize)
        
        if layoutWidth > 0 {
            preferredMaxLayoutWidth = layoutWidth
            numberOfLines = 0
        }
        sizeToFit()
    }
    
}
